using Rsd.Dudu;
using Rsd.Dudu.Admin.Core;
using Rsd.Dudu.ModelProvider;
using Rsd.Dudu.ORM;
using Rsd.Dudu.Web.Core;
using Rsd.Faith.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace Rsd.Faith.Models
{
    [Table("sys_users", "sys_users", "id")]
    [Serializable]
    public class SysUsersModel : Rsd.Faith.Core.ModelBase, ISysUser
    {

        /// <summary>
        /// 姓名
        /// </summary>
        [StringType("xing_ming", "姓名", 20, 20)]
        [DisplayName("姓名")]
        public string XingMing { get; set; }

        /// <summary>
        /// 登录名
        /// </summary>
        [StringType("deng_lu_ming", "登录名", 22, 20)]
        [DisplayName("登录名")]
        public string DengLuMing { get; set; }

        /// <summary>
        /// 角色_ID
        /// </summary>
        [StringType("jiao_se_id", "角色_ID", 24, 40)]
        [DisplayName("角色_ID")]
        public int JiaoSeId { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [StringType("mi_ma", "密码", 26, 50)]
        [DisplayName("密码")]
        public string MiMa { get; set; }
        string ISysUser.Password { get => this.MiMa; set => this.MiMa= value; }
        string ISysUser.Salt { get => "h7fF&d"; set { } }
        int ISysUser.RoleId { get => this.JiaoSeId; set => this.JiaoSeId = value; }
        string ISysUser.RealName { get => this.XingMing; set => this.XingMing = value; }
        int ISysUser.Status { get => 0; set { } }

        long ISessionData.Id => this.Id;

        string ISessionData.Key => this.Key;

        string ISessionData.UserName => this.DengLuMing;

        /// <summary>
        /// 
        /// </summary>
        public SysUsersModel()
        { }

    }
}
